package com.qf.dao;

import com.qf.entity.Branch;
import com.qf.entity.Subitem;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

/**
 * @ClassName SubitemDao
 * @Description TODO
 * @Author 86181
 * @Date 2022/8/28 17:49
 * @Version 1.0
 **/
public interface SubitemDao {
    @Results(id = "subitemMap",value = {
            @Result(column = "suid",property = "suid"),
            @Result(column = "sname",property = "sname"),
            @Result(column = "starttime",property = "starttime"),
            @Result(column = "pid",property = "pid"),
            @Result(column = "updatetime",property = "updatetime"),
            @Result(column = "status",property = "status"),
            @Result(column = "suid",property = "items",
                    many = @Many(select = "com.qf.dao.ItemDao.findItemsBySuid",
                            fetchType = FetchType.EAGER))

    })
    @Select("select * from subitem where status=1")
    List<Subitem> findSubitems();


}
